<?php TPL::output('admin/global/header.tpl.htm'); ?>
<?php TPL::output('admin/global/nav_menu.tpl.htm'); ?>

<div class="aw-content-wrap">
    <div class="mod">
        <div class="mod-head">
            <h3>
                <ul class="nav nav-tabs">
                    <li class="active"><a href="admin/edm/receiving_list/"><?php _e('账号列表'); ?></a></li>
                    <li><a href="admin/edm/receiving_config/"><?php _e('全局设置'); ?></a></li>
                    <li><a href="admin/edm/receiving/"><?php _e('新增账号'); ?></a></li>
                </ul>
            </h3>
        </div>

        <div class="mod-body tab-content">
            <div class="table-responsive">
                <?php if ($this->accounts_total > 0) { ?>
                <table class="table table-striped">
                    <thead>
                        <tr>
                            <th><?php _e('POP3 服务器'); ?></th>
                            <th><?php _e('邮箱账号'); ?></th>
                            <th><?php _e('本地用户'); ?></th>
                            <th><?php _e('操作'); ?></th>
                        </tr>
                    </thead>

                    <tbody>
                        <?php foreach ($this->receiving_email_list AS $account_info) { ?>
                        <tr>
                            <td><?php echo $account_info['server']; ?></td>

                            <td><?php echo $account_info['username']; ?></td>

                            <td><a href="people/<?php echo $this->users_info[$account_info['uid']]['url_token']; ?>" target="_blank"><?php echo $this->users_info[$account_info['uid']]['user_name']; ?></a></td>

                            <td class="nowrap">
                                <a href="admin/edm/receiving/id-<?php echo $account_info['id']; ?>" data-toggle="tooltip" title="<?php _e('编辑'); ?>" class="icon icon-edit md-tip"></a>

                                <a href="javascript:;" onclick="AWS.ajax_request(G_BASE_URL + '/admin/ajax/remove_receiving_account/', 'id=<?php echo $account_info['id'] ?>');" data-toggle="tooltip" title="<?php _e('删除'); ?>" class="icon icon-trash md-tip"></a>
                            </td>
                        </tr>
                        <?php } ?>
                    </tbody>
                </table>
                <?php } ?>
            </div>

            <div class="mod-table-foot">
                <?php echo $this->pagination; ?>
            </div>
        </div>
    </div>
</div>

<?php TPL::output('admin/global/footer.tpl.htm'); ?>